/*
 * GravarContatoAction.java
 *
 * Created on 18 de Novembro de 2006, 12:38
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package action;

import controller.Action;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.servlet.http.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import model.Instrutor;
import percistence.InstrutorDAO;

public class ConsultarInstrutorAction implements Action {
    
    public ConsultarInstrutorAction() {
    }
    
    public void execute(HttpServletRequest request,
            HttpServletResponse response ) throws IOException {
        List<Instrutor> listInstrutores = new ArrayList<Instrutor>();
           try {
              listInstrutores.addAll(InstrutorDAO.getInstance().carregarInstrutores());
              for (Iterator i = listInstrutores.iterator(); i.hasNext();){
                    System.out.println(i.next());
              }
            } catch (ClassNotFoundException ex) {
                Logger.getLogger(ConsultarInstrutorAction.class.getName()).log(Level.SEVERE, null, ex);
            } catch (SQLException ex) {
            Logger.getLogger(ConsultarInstrutorAction.class.getName()).log(Level.SEVERE, null, ex);
        }
        }
    }

